package com.example.cloud.model.inventory;


import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import javax.persistence.Version;
import java.util.Date;

/**
 * Created by wangtao on 2018/7/30.
 * 库存明细
 */
@Entity(name = "inventory_details")
@Data
@EqualsAndHashCode(callSuper = false)
public class InventoryDetails extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 库存主键
    @Column(name = "inventory_id")
    private Long inventoryId;
    // 商品编号
    @Column(name = "item_id")
    private Long itemId;
    // 商品名称
    @Column(name = "item_name")
    private String itemName;
    // 入库类型主键
    @Column(name = "type_id")
    private Long typeId;
    // 入库类型名称
    @Column(name = "type_name")
    private String typeName;
    // 供应商编号
    @Column(name = "supplier_id")
    private Long supplierId;
    // 供应商名称
    @Column(name = "supplier_name")
    private String supplierName;
    // 维修商编号
    @Column(name = "repairer_id")
    private Long repairerId;
    // 维修商名称
    @Column(name = "repairer_name")
    private String repairerName;
    // 过期时间
    @Column(name = "expired_date")
    private Date expiredDate;
    // 总库存
    @Column(name = "total_inventory", columnDefinition = "INT DEFAULT 0")
    private int totalInventory;
    // 可用库存
    @Column(name = "use_inventory", columnDefinition = "INT DEFAULT 0")
    private int useInventory;
    // 锁定库存
    @Column(name = "lock_inventory", columnDefinition = "INT DEFAULT 0")
    private int lockInventory;
    // 商品形态{0：正常品 1：异常品}
    @Column(name = "normal_flag", columnDefinition = "INT DEFAULT 0")
    private int normalFlag;
    @Version
    @Column(name = "version")
    private Integer version;
    @Transient
    private int quantity;
    @Transient
    private String remark;
}
